package com.fzhucc.modules.large;
import com.fzhucc.annotation.AnonymousAccess;
import com.fzhucc.annotation.Log;
import com.fzhucc.annotation.rest.AnonymousGetMapping;
import com.fzhucc.annotation.rest.AnonymousPostMapping;
import com.fzhucc.modules.large.dto.LargeH5AreaDto;
import com.fzhucc.modules.large.dto.LargeH5Dto;
import com.fzhucc.modules.large.service.LargeZqxService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;

import java.text.ParseException;

/**
 * @author yyg
 * @date 2024-01-04
 **/
@RestController
@RequiredArgsConstructor
@Api(tags = "助企行：大屏h5展示")
@RequestMapping("/api/zqx/h5/large")
public class LargeZqxH5Controller {

    private final LargeZqxService largeZqxService;

    @Log("查询关键数据")
    @ApiOperation("查询关键数据")
    @AnonymousPostMapping("/getH5CriticalData")
    public ResponseEntity<Object> getH5CriticalData(@RequestBody LargeH5AreaDto largeH5AreaDto) {
        return new ResponseEntity<>(largeZqxService.getH5CriticalData(largeH5AreaDto), HttpStatus.OK);
    }

    @Log("查询需求匹配情况")
    @ApiOperation("查询需求匹配情况")
    @AnonymousPostMapping("/getH5XqData")
    public ResponseEntity<Object> getH5XqData(@RequestBody LargeH5AreaDto largeH5AreaDto) {
        return new ResponseEntity<>(largeZqxService.getH5XqData(largeH5AreaDto), HttpStatus.OK);
    }


    @Log("查询h5时间加地区数据")
    @ApiOperation("查询h5时间加地区数据")
    @AnonymousPostMapping("/getH5TimeArea")
    public ResponseEntity<Object> getH5TimeArea(@RequestBody LargeH5Dto largeH5Dto) throws ParseException {
        return new ResponseEntity<>(largeZqxService.getH5TimeArea2(largeH5Dto), HttpStatus.OK);
    }

    @Log("查询h5劳模折线图数据前7天")
    @ApiOperation("查询h5劳模折线图数据前7天")
    @AnonymousPostMapping("/getH5ModelZxByArea")
    public ResponseEntity<Object> getH5ModelZxByArea(@RequestBody LargeH5AreaDto largeH5AreaDto) {
        return new ResponseEntity<>(largeZqxService.getH5ModelZxByArea(largeH5AreaDto), HttpStatus.OK);
    }

    @Log("查询h5需求折线图数据前7天")
    @ApiOperation("查询h5需求折线图数据前7天")
    @AnonymousPostMapping("/getH5XqZxByArea")
    public ResponseEntity<Object> getH5XqZxByArea(@RequestBody LargeH5AreaDto largeH5AreaDto) {
        return new ResponseEntity<>(largeZqxService.getH5XqZxByArea(largeH5AreaDto), HttpStatus.OK);
    }

    @Log("查询h5技术服务队折线图数据前7天")
    @ApiOperation("查询h5技术服务队折线图数据前7天")
    @AnonymousPostMapping("/getH5XqTsByArea")
    public ResponseEntity<Object> getH5XqTsByArea(@RequestBody LargeH5AreaDto largeH5AreaDto) {
        return new ResponseEntity<>(largeZqxService.getH5XqTsByArea(largeH5AreaDto), HttpStatus.OK);
    }

    @Log("查询h5资讯折线图数据前7天")
    @ApiOperation("查询h5资讯折线图数据前7天")
    @AnonymousPostMapping("/getH5ZxZxByArea")
    public ResponseEntity<Object> getH5ZxZxByArea(@RequestBody LargeH5AreaDto largeH5AreaDto) {
        return new ResponseEntity<>(largeZqxService.getH5ZxZxByArea(largeH5AreaDto), HttpStatus.OK);
    }

    @Log("查询h5创新成果折线图数据前7天")
    @ApiOperation("查询h5创新成果折线图数据前7天")
    @AnonymousPostMapping("/getH5CgZxByArea")
    public ResponseEntity<Object> getH5CgZxByArea(@RequestBody LargeH5AreaDto largeH5AreaDto) {
        return new ResponseEntity<>(largeZqxService.getH5CgZxByArea(largeH5AreaDto), HttpStatus.OK);
    }

    @Log("查询h5工作室折线图数据前7天")
    @ApiOperation("查询h5工作室折线图数据前7天")
    @AnonymousPostMapping("/getH5StudioZxByArea")
    public ResponseEntity<Object> getH5StudioZxByArea(@RequestBody LargeH5AreaDto largeH5AreaDto) {
        return new ResponseEntity<>(largeZqxService.getH5StudioZxByArea(largeH5AreaDto), HttpStatus.OK);
    }

    @Log("查询h5浏览量折线图数据前7天")
    @ApiOperation("查询h5浏览量折线图数据前7天")
    @AnonymousPostMapping("/getH5LllZxByArea")
    public ResponseEntity<Object> getH5LllZxByArea(@RequestBody LargeH5AreaDto largeH5AreaDto) {
        return new ResponseEntity<>(largeZqxService.getH5LllZxByArea(largeH5AreaDto), HttpStatus.OK);
    }

    @Log("查询h5注册量折线图数据前7天")
    @ApiOperation("查询h5注册量折线图数据前7天")
    @AnonymousPostMapping("/getH5ZclZxByArea")
    public ResponseEntity<Object> getH5ZclZxByArea(@RequestBody LargeH5AreaDto largeH5AreaDto) {
        return new ResponseEntity<>(largeZqxService.getH5ZclZxByArea(largeH5AreaDto), HttpStatus.OK);
    }



}